# == Class guacamole::config
#
# This class is called from guacamole
#
class guacamole::config (
){
  $usermapping = "/tmp/user-mapping.xml"

  concat{$usermapping:
    owner => root,
    group => root,
    mode  => '0644',
  }

  concat::fragment{"usermapping_header":
    target  => $usermapping,
    order   => 01,
    content => "<user-mapping>\n  <authorize username=\"testuser\" password=\"testme\">\n",
  }

  # collect exported rdp / ssh interfaces
  Guacamole::Config::Register <<| tag == 'remoteman_interfaces' |>>  {
  }
  Guacamole::Config::Register <| tag == 'remoteman_interfaces' |>  {
  }

  concat::fragment{"usermapping_footer":
    target  => $usermapping,
    order   => 15,
    content => "\n  </authorize>\n</user-mapping>\n",
  }

  @@guacamole::config::register{"MyTest configuration":
    tag      => 'remoteman_interfaces',
    username => 'Administrator',
    password => 'GpPH9=$Xaw',
    hostname => '10.0.0.54',
    protocol => 'rdp',
  }

  @@guacamole::config::register{"$::fqdn":
    tag        => 'remoteman_interfaces',
    username   => 'ubuntu',
    hostname   => $::fqdn,
    protocol   => 'ssh',
    privatekey => '-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAgqYocgEza3Rz3Oz/7wLNsssTCNGfomALtO91zK0hgobORhOm4l/6iMpQG/m8
QX5CHuXCIV3px64ZlRSBqyerpwNtRFucA/BYlSxCfVEUW5/cosQVEjuPkkFbKN49SQosRRyvxulA
34mAraazuyCwkwpmH3NRkVv/xuoEvy7asCWUfOS5bcS1d+faoRAtd7/E4XTEktM1fsztLM112zKC
afBkgjW/fot3kmV/cU3QCp9nJj3LI7aQ3O2FaE7RvKdQtC5CuSS9qiXsitObVV1fPIVjOhpimX5E
gwKOTBmH2Wb5QUF01a7qAvfDmsbgn0q3iV8KCsZ4KFaKb7n4RD24vQIDAQABAoIBAB1iaa5afsoo
QvbphxamtsUDz6AoJZNLrtZfFUuXlPXahAJW4S4BEEQ73JCuNp00XIK+gk8m5DG5Ap/5IMDyBzVl
G+pIAGsSX5oNflbZKY8CAYnKOEMFimEGug4TDg2jcBmLPi2qwKCGOJ7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